
#ifndef __RT_SOFTDOGLICENSECONTROL_H__
#define __RT_SOFTDOGLICENSECONTROL_H__

#include "RtDefines.h"

const RtResult DOG_ERROR_BASE = 100;
const RtResult DOG_ERROR_DOG_NOT_FOUND = DOG_ERROR_BASE + 1; 
const RtResult DOG_ERROR_READ_DOG_FAIL = DOG_ERROR_BASE + 2; 
const RtResult DOG_ERROR_WRITE_DOG_FAIL = DOG_ERROR_BASE + 3; 
const RtResult DOG_ERROR_CONVERT_FAIL = DOG_ERROR_BASE + 4; 
const RtResult DOG_ERROR_INVALID_DOGDATA = DOG_ERROR_BASE + 5; 
const RtResult DOG_ERROR_SYSTEMTIME_TAMPERED = DOG_ERROR_BASE + 6; 
const RtResult DOG_ERROR_TRIAL_EXPIRED = DOG_ERROR_BASE + 7; 
const RtResult DOG_ERROR_MAXUSERNUM_OF_ALLCONF_LIMITED = DOG_ERROR_BASE + 8; 
const RtResult DOG_ERROR_MAXUSERNUM_OF_ONECONF_LIMITED = DOG_ERROR_BASE + 9; 
const RtResult DOG_ERROR_MAX_IMONLINE_USERNUM_LIMITED = DOG_ERROR_BASE + 10;
const RtResult DOG_ERROR_UNINITIALIZED = DOG_ERROR_BASE + 11;
const RtResult DOG_ERROR_LICENSE_TICKET_UNMATCHED = DOG_ERROR_BASE + 12;
const RtResult DOG_ERROR_LICENSE_TICKET_NULL = DOG_ERROR_BASE + 13;

class CRtSoftDogInternal;

class RT_API_EXPORT CRtSoftDogLicenseControl
{
public:
	CRtSoftDogLicenseControl();
	virtual ~CRtSoftDogLicenseControl();

public:
	RtResult Initialize(const CRtString& inTicket = "");
	void Release();
	RtResult CheckUserNumOfAllConf(DWORD dwUserNumOfAllConf);
	RtResult CheckUserNumOfOneConf(WORD nUserNumOfCurConf);
	RtResult CheckImOnlineUserNum(DWORD dwImOnlineUserNum);

protected:
	CRtSoftDogInternal* m_pImp;
};

#endif // __RT_SOFTDOGLICENSECONTROL_H__
